<?

if ($DATA['component']['id']) {

	$_record = array('id_data' => D_MB_DATA, 'id_parent' => $DATA['component']['id']);
																										  
	$_fields = array(
		'text' => array('large' => true, 'lang' => true), 
	);

	switch (action(array('editor_save'))) {
	
		case 'editor_save':

			dataset('killmeta', "(id_data=".D_MB_DATA.") AND (id_parent={$DATA[component][id]})");
			dataset('savemeta', prepareModel($_fields, $_record));
			
			return true;	// end of component edition
	}
	
		
	$DATA['object'] = array();

	foreach($DATA['langs'] as $lang)
		$DATA['object'][$lang['text']] = datafetch_array('loadmeta', D_MB_DATA, 
			array('parent' => $DATA['component']['id'], 'assoc' => $lang['text'], 'getclob' => true));
	
	return false;

} else exit;